#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "workerthread.h"

#include <QMainWindow>
#include <QProgressBar>
#include <QBoxLayout>
#include <QPushButton>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    // 更新进度
    void handleResults(int value);

    // 开启线程
    void startThread();
    // 关闭线程
    void stopThread();
private:
    Ui::MainWindow *ui;

    QProgressBar *m_pProgressBar;
    QPushButton *m_pStartButton;
    QPushButton *m_pStopButton;
    QHBoxLayout *m_pControlHBLayout;
    QVBoxLayout *m_pGlobalVBLayout;
    WorkerThread *m_pWorkerThread;
};

#endif // MAINWINDOW_H
